module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: [
    [
      'module:react-native-dotenv',
      {
        envName: 'APP_ENV',
        moduleName: '@env',
        path: '.env',
        blocklist: null,
        allowlist: null,
        safe: false,
        allowUndefined: true,
        verbose: false,
      },
    ],
    // 生产环境移除 console.log
    process.env.NODE_ENV === 'production' && [
      'transform-remove-console',
      {
        exclude: ['error', 'warn'], // 保留 error 和 warn 用于错误追踪
      },
    ],
  ].filter(Boolean),
};
